using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AceEngineering.SPM.SPMDataLayer;
using Microsoft.AceEngineering.SPM.SPMCustomDataEntity;
using System.Data;

namespace Microsoft.AceEngineering.SPM.SPMBusinessLayer
{
    public class ScoreRangeTaskBL
    {
        public static DataSet dsLoadDataSet(string strStoredProc)
        {
            return WTRIAssessmentDL.dsLoadDataSet(strStoredProc);
        }

        public static List<ScoreRangeTaskCDE> GetEnabledScoreRangeTask(int scoreRangeID, string dir)
        {
            string tmpDir = null;
            string tmpExpr = null;
            if (dir.Length != 0)
            {
                if (dir.Contains("DESC"))
                    tmpDir = "DESC";
                else
                    tmpDir = "ASC";
             
                if (dir.Contains("TaskName"))
                    tmpExpr = "TaskName";
                else
                    tmpExpr = "LifeCycleName";
            }

            return ScoreRangeTaskDL.GetScoreRangeTask(scoreRangeID, tmpExpr, tmpDir, true);
        }

        public static List<ScoreRangeTaskCDE> GetDisabledScoreRangeTask(int scoreRangeID, string dir)
        {
            string tmpDir = null;
            string tmpExpr = null;
            if (dir.Length != 0)
            {
                if (dir.Contains("DESC"))
                    tmpDir = "DESC";
                else
                    tmpDir = "ASC";
                
                if (dir.Contains("TaskName"))
                    tmpExpr = "TaskName";
                else
                    tmpExpr = "LifeCycleName";
            }

            return ScoreRangeTaskDL.GetScoreRangeTask(scoreRangeID, tmpExpr, tmpDir, false);
        }

        public static void DeleteMapping(int scoreID, string taskID)
        {

            ScoreRangeTaskDL.DeleteMapping(scoreID, taskID);
        }

        public static void CreateMapping(int scoreID, string taskID, string createdBy)
        {
            ScoreRangeTaskDL.CreateMapping(scoreID, taskID, createdBy);
        }

        public static void Delete(string TaskID)
        {
            //Do Nothing
        }
    }
}
